package Batch::Simple::Result;
use Modern::Perl;
use strict;
use warnings;
use Moose;

has 'stdout' => (
  is => 'rw',
  isa => 'Str',
  default => '',
);

has 'stderr' => (
  is => 'rw',
  isa => 'Str',
  default => '',
);

has 'status' => (
  is => 'rw',
  isa => 'Int',
  default => 0,
);

has 'separator' => (
  is => 'rw',
  isa => 'Str',
  default => '',
);

use overload q{""} => \&_toString,
             bool  => \&_toBool,
             fallback => 1;

sub _toString {
  my $self = shift;

  $self->stderr.$self->separator.$self->stdout;
}

sub _toBool {
  my $self = shift;

  !$self->status;
}

1;











